package com.a2020111222.test.pojo;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @author Administrator
 * @version 1.0
 * @description: TODO
 * @date 2022/11/6 11:45
 */
@Data
@Component("userNotes")
@Scope("singleton")
public class userNotes {
        @Value("1")
        private int id;
        @Value("YangSir")
        private String name;
        @Value("123")
        private String password;

        @PostConstruct
        public void init(){
                System.out.println("初始化bean");
        }

        @PreDestroy
        public void destroy(){
                System.out.println("销毁bean");
        }
}
